- /* howpow2.cpp by K.Tsuru */
- // function ID = 002
- /*****************************************
- SNumber sub-function
- Return a value n which satisfies a condition p<= 2^n.
- e.g. p = 5 --> n = 3
- *****************************************/
- #ifndef TYPEDEF_H
- #include "typedef.h"
- #endif
-
- uint howpow2(uint p){
- if(p < 2) return 0;
- uint j = 0, k = 1;
- while(k < p){ k *= 2; j++; }
- return j;
- }
howpow2.cpp : last modifiled at 2015/09/06 16:07:02(410 bytes)
created at 2016/04/11 11:17:20
The creation time of this html file is 2017/10/07 10:54:15 (Sat Oct 07 10:54:15 2017).